#define DEBUG

void debug(const std::string &str) {
#ifdef DEBUG
  std::cout << str << std::endl;
  std::cout.flush();
#endif
}